1. Field of the Invention
The present invention relates to communication apparatuses and control methods thereof, communication systems, and storage medium.
2. Description of the Related Art
Recent years have seen an increase in printing apparatuses, such as multifunction peripherals, printers, and the like, that include wireless LAN functionality. Printing apparatuses that include wireless LAN functionality typically have a function for wirelessly connecting to an access point as a client. Meanwhile, by communicating with the printing apparatus via the access point, PCs, mobile terminals, and the like can cause the printing apparatus to execute printing by transmitting desired data thereto, and can be used to manage the printing apparatus by receiving device information from the printing apparatus.
The Wi-Fi Direct® standard has recently been established by the Wi-Fi Alliance. Wi-Fi Direct defines a protocol for determining whether a wireless terminal will function as an access point or as a client. Which wireless terminal will function as an access point and which wireless terminal will function as a client can be determined automatically by executing this protocol. Using Wi-Fi Direct enables wireless terminals to communicate with each other directly and execute various types of application services (image sharing, printing, and the like) without needing to prepare a separate access point.
Printing apparatuses capable of executing the aforementioned protocol are configured so that a user can use a console or the like to instruct whether to carry out direct wireless communication using Wi-Fi Direct, or to carry out wireless communication indirectly via a third-party access point.
Meanwhile, recent printing apparatuses often include applications for communicating with a server. Simple Network Time Protocol (SNIP) and Post Office Protocol (POP) can be given as examples of applications that periodically communicate with a server. Such printing apparatuses also have event transmission applications for communicating with a server in the case where an event such as an error has occurred. Furthermore, such printing apparatuses have timed transmission applications, such as Simple Mail Transfer Protocol (SMTP), IPFAX (Internet Protocol Fax), and so on, in which the apparatus communicates with a server when a given time has been reached.
However, such applications cannot communicate with the server in the Wi-Fi Direct environment, and thus if an application for communicating with a server is activated while the printing apparatus is operating in Wi-Fi Direct, there is a problem that the communication fails.
To solve such a problem, a technique has been proposed in which a retransmission time is extended until communication with a server is possible and retransmission is repeated until communication with the server succeeds (Japanese Patent Laid-Open No. 2000-163348, for example). According to the technique disclosed in Japanese Patent Laid-Open No. 2000-163348, the communication with the server succeeds after the printing apparatus switches to an infrastructure mode.
However, the retransmission process is executed in the Wi-Fi Direct environment in Japanese Patent Laid-Open No. 2000-163348, which can result in unnecessary communication, errors, and the like, leading in turn to unnecessary processing being performed by a CPU. There is a further problem in that the application cannot communicate with the server in the Wi-Fi Direct environment, resulting in transmission failures that remain in a history as transmission errors.
Meanwhile, depending on the communicating application, there are cases where it is preferable to immediately switch to the infrastructure mode and communicate with the server, rather than waiting to switch to the infrastructure mode. For example, in the case where an error, an urgent event such as a paper jam, or the like has occurred in the printing apparatus, it is necessary to immediately notify the server of the status of the printing apparatus. Downtime in the printing apparatus can be reduced by the server that received the notification transferring the information to an administrator or the like and having the administrator proceed immediately to the location of the printing apparatus.
However, with the aforementioned conventional technique, the server cannot be notified of the status of the printing apparatus until the printing apparatus switches to the infrastructure mode, even if an urgent event has occurred while the printing apparatus is operating in Wi-Fi Direct. This delays the administrator's response and leads to longer downtime in the printing apparatus.
In addition, there is demand for higher reliability in timed transmission functions for IPFAX, email transmission, and so on. Accordingly, if the printing apparatus is operating in Wi-Fi Direct when the timer reaches the specified time, the printing apparatus will be unable to communicate with the server at that time and the transmission will fail. Furthermore, even if the printing apparatus transmits to the server upon the printing apparatus switching to the infrastructure mode, the transmission will occur at a different time than that intended by the user, causing a problem in that the printing apparatus operates less reliably.